package Vista;

import java.awt.BorderLayout;

import javax.swing.JPanel;
import net.miginfocom.swing.MigLayout;
import javax.swing.JLabel;
import java.awt.Color;
import java.awt.Font;
import javax.swing.border.LineBorder;
import javax.swing.JTextField;
import java.awt.Dimension;
import javax.swing.JComboBox;
import javax.swing.SwingConstants;
import javax.swing.JButton;
import javax.swing.JTable;

public class Panel_MCliente_Taller extends JPanel {

	private JPanel panelVerde;
	private JPanel panelVerdeSup;
	private JPanel panelVerdeCentro;
	private JPanel panelAzul;
	private JPanel panelAzulSup;
	private JPanel panelAzulCentro;
	private JPanel panelNaranja;
	private JPanel panelNaranjaSup;
	private JPanel panelNaranjaCentro;
	private JPanel panelMorado;
	private JPanel panelMoradoSup;
	private JPanel panelMoradoCentro;
	private JPanel panelInfBotones;
	
	// Etiquetas
	private JLabel labelOperacion;
	private JLabel labelVehiculo;
	private JLabel labelTiempo;
	private JLabel labelImporte;
	private JLabel labelMarca;
	private JLabel labelModelo;
	private JLabel labelMotor;
	private JLabel labelHoras;
	private JLabel labelEuros;
	
	// ComboBox
	private JComboBox comboMarca;
	private JComboBox comboModelo;
	private JComboBox comboMotor;
	
	// Campo texto
	private JTextField campoTiempo;
	private JTextField campoImporte;
	
	// Botones
	private JButton botonPagar;
	private JButton botonRestablecer;
	
	// Tablas
	private JTable tablaOperacion;
	
	/**
	 * Create the panel.
	 */
	public Panel_MCliente_Taller() {
		
		this.setLayout(new MigLayout("", "[30.00][400.00,grow][50.00][110.00,grow][][110.00,grow][30.00]", "[10.00][303.00][21.00,grow][102.00][10.00][][10.00]"));
		
		// panelVerde
		panelVerde = new JPanel();
		panelVerde.setBorder(new LineBorder(new Color(46, 139, 87), 3));
		panelVerde.setBackground(new Color(204, 255, 204));
		this.add(panelVerde, "cell 1 1 1 3,grow");
		panelVerde.setLayout(new BorderLayout(0, 0));
		
		// panelVerdeSup
		panelVerdeSup = new JPanel();
		panelVerdeSup.setBackground(new Color(46, 139, 87));
		panelVerde.add(panelVerdeSup, BorderLayout.NORTH);
		
		// panelVerdeCentro
		panelVerdeCentro = new JPanel();
		panelVerdeCentro.setBackground(new Color(204, 255, 204));
		panelVerde.add(panelVerdeCentro, BorderLayout.CENTER);
		panelVerdeCentro.setLayout(new MigLayout("", "[grow]", "[grow]"));
		
		// panelAzul
		panelAzul = new JPanel();
		panelAzul.setBorder(new LineBorder(new Color(70, 130, 180), 3));
		panelAzul.setBackground(new Color(176, 196, 222));
		this.add(panelAzul, "cell 3 1 3 1,grow");
		panelAzul.setLayout(new BorderLayout(0, 0));
		
		// panelAzulSup
		panelAzulSup = new JPanel();
		panelAzulSup.setBackground(new Color(70, 130, 180));
		panelAzul.add(panelAzulSup, BorderLayout.NORTH);
		
		// panelAzulCentro
		panelAzulCentro = new JPanel();
		panelAzulCentro.setBackground(new Color(176, 196, 222));
		panelAzul.add(panelAzulCentro, BorderLayout.CENTER);
		panelAzulCentro.setLayout(new MigLayout("", "[grow]", "[grow][][grow][][grow][][grow]"));
		
		// panelNaranja
		panelNaranja = new JPanel();
		panelNaranja.setBorder(new LineBorder(new Color(255, 140, 0), 3));
		panelNaranja.setBackground(new Color(255, 222, 173));
		this.add(panelNaranja, "cell 3 3,grow");
		panelNaranja.setLayout(new BorderLayout(0, 0));
		
		// panelNaranjaSup
		panelNaranjaSup = new JPanel();
		panelNaranjaSup.setBackground(new Color(255, 140, 0));
		panelNaranja.add(panelNaranjaSup, BorderLayout.NORTH);
		
		// panelNaranjaCentro
		panelNaranjaCentro = new JPanel();
		panelNaranjaCentro.setBackground(new Color(255, 222, 173));
		panelNaranja.add(panelNaranjaCentro, BorderLayout.CENTER);
		panelNaranjaCentro.setLayout(new MigLayout("", "[grow]", "[grow]"));
		
		// panelMorado
		panelMorado = new JPanel();
		panelMorado.setBorder(new LineBorder(new Color(186, 85, 211), 3));
		panelMorado.setBackground(new Color(216, 191, 216));
		this.add(panelMorado, "cell 5 3,grow");
		panelMorado.setLayout(new BorderLayout(0, 0));
		
		// panelMoradoSup
		panelMoradoSup = new JPanel();
		panelMoradoSup.setBackground(new Color(186, 85, 211));
		panelMorado.add(panelMoradoSup, BorderLayout.NORTH);
		
		// panelMoradoCentro
		panelMoradoCentro = new JPanel();
		panelMoradoCentro.setBackground(new Color(216, 191, 216));
		panelMorado.add(panelMoradoCentro, BorderLayout.CENTER);
		panelMoradoCentro.setLayout(new MigLayout("", "[grow]", "[grow]"));
		
		// panelInfBotones
		panelInfBotones = new JPanel();
		this.add(panelInfBotones, "cell 3 5 3 1,alignx right,growy");
		panelInfBotones.setLayout(new BorderLayout(10,0));
		
		
		// INSTANCIAR CAMPOS TEXTO
		// campoTiempo
		campoTiempo = new JTextField();
		campoTiempo.setHorizontalAlignment(SwingConstants.CENTER);
		campoTiempo.setPreferredSize(new Dimension(4, 30));
		campoTiempo.setFont(new Font("Dialog", Font.BOLD, 18));
		panelNaranjaCentro.add(campoTiempo, "flowx,cell 0 0,growx");
		campoTiempo.setColumns(10);
		
		// campoImporte		
		campoImporte = new JTextField();
		campoImporte.setEditable(false);
		campoImporte.setForeground(new Color(0, 0, 205));
		campoImporte.setBackground(new Color(230, 230, 250));
		campoImporte.setHorizontalAlignment(SwingConstants.CENTER);
		campoImporte.setMinimumSize(new Dimension(4, 30));
		campoImporte.setFont(new Font("Dialog", Font.BOLD, 18));
		panelMoradoCentro.add(campoImporte, "flowx,cell 0 0,growx");
		campoImporte.setColumns(10);
		
				
		// INSTANCIAR ETIQUETAS
		// labelOperacion
		labelOperacion = new JLabel("Operación");
		labelOperacion.setFont(new Font("Dialog", Font.BOLD, 20));
		labelOperacion.setForeground(new Color(255, 255, 255));
		panelVerdeSup.add(labelOperacion);
		
		// labelVehiculo
		labelVehiculo = new JLabel("Vehículo");
		labelVehiculo.setForeground(new Color(255, 255, 255));
		labelVehiculo.setFont(new Font("Dialog", Font.BOLD, 20));
		panelAzulSup.add(labelVehiculo);
		
		// labelTiempo
		labelTiempo = new JLabel("Tiempo");
		labelTiempo.setForeground(new Color(255, 255, 255));
		labelTiempo.setFont(new Font("Dialog", Font.BOLD, 20));
		panelNaranjaSup.add(labelTiempo);
		
		// labelImporte
		labelImporte = new JLabel("Importe");
		labelImporte.setForeground(new Color(255, 255, 255));
		labelImporte.setFont(new Font("Dialog", Font.BOLD, 20));
		panelMoradoSup.add(labelImporte);
		
		// labelMarca		
		labelMarca = new JLabel("Marca: ");
		labelMarca.setFont(new Font("Dialog", Font.PLAIN, 18));
		panelAzulCentro.add(labelMarca, "flowx,cell 0 1");
		
		// labelModelo
		labelModelo = new JLabel("Modelo: ");
		labelModelo.setFont(new Font("Dialog", Font.PLAIN, 18));
		panelAzulCentro.add(labelModelo, "flowx,cell 0 3");
		
		// labelMotor
		labelMotor = new JLabel("Motor: ");
		labelMotor.setFont(new Font("Dialog", Font.PLAIN, 18));
		panelAzulCentro.add(labelMotor, "flowx,cell 0 5");
		
		// labelHoras
		labelHoras = new JLabel("horas");
		labelHoras.setFont(new Font("Dialog", Font.PLAIN, 18));
		panelNaranjaCentro.add(labelHoras, "cell 0 0");
		
		// labelEuros
		labelEuros = new JLabel("€uros");
		labelEuros.setFont(new Font("Dialog", Font.PLAIN, 18));
		panelMoradoCentro.add(labelEuros, "cell 0 0");
		
		
		// INSTANCIAR COMBOBOX
		// comboMarca		
		comboMarca = new JComboBox();
		comboMarca.setPreferredSize(new Dimension(4, 40));
		panelAzulCentro.add(comboMarca, "cell 0 1,grow");
		
		// comboModelo
		comboModelo = new JComboBox();
		comboModelo.setPreferredSize(new Dimension(32, 40));
		panelAzulCentro.add(comboModelo, "cell 0 3, grow");
		
		// comboMotor		
		comboMotor = new JComboBox();
		comboMotor.setPreferredSize(new Dimension(32, 40));
		panelAzulCentro.add(comboMotor, "cell 0 5, grow");

		
		// INISTANCIAR BOTONES
		// botonRestablecer
		botonRestablecer = new JButton("Restablecer");
		botonRestablecer.setFont(new Font("Dialog", Font.PLAIN, 20));
		panelInfBotones.add(botonRestablecer, BorderLayout.WEST);
		
		// botonPagar
		botonPagar = new JButton("Pagar");
		botonPagar.setFont(new Font("Dialog", Font.BOLD, 20));
		panelInfBotones.add(botonPagar, BorderLayout.EAST);
		
		
		// INSTANCIAR TABLAS
		// tablaOperacion
		tablaOperacion = new JTable();
		panelVerdeCentro.add(tablaOperacion, "cell 0 0,grow");		
		
	}

}
